import axios from '../axios'
import {MANAGER} from '../../CONST'

export default{
/**
 * 
 * @param { {"account": "string","password": "string","permIds": [0],"roleId": 0} } data 
 */
    addManager(data){
        return axios({
            url:MANAGER+'/add',
            method:'POST',
            data 
        })
    }, 
    //新增管理员

    /**
     * 
     * @param {"id"} id 
     */
    delManager(id){
        return axios.get(MANAGER+'/delete/'+id)
    },//删除管理员

    getManagerList(){
        return axios.post(MANAGER+'/list')
    },//获取管理员列表

    /**
     * 
     * @param {{"account":string,"password":string}} data 
     */
    login(params){
        return axios(
            {
                method:'POST',
                url:MANAGER+'/login',
                params
            }
        )
    },//管理员登录

    /**
     * 
     * @param { {"account": "string","password": "string","permIds": [0],"roleId": 0} } data 
     */
    updateManager(data){
        return axios.post(MANAGER+'/update',data)
    }//修改管理员

}